/* 
 * Copyright [2018] [Alex/libo(liboms@hotmail.com)]
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.hyts.guava.imcollection;

import java.util.Collection;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import com.google.common.collect.ImmutableSet;

/** 
 * @title ImmutableSets.java  
 * @package com.hyts.guava.collection  
 * @description TODO  
 * @see TODO
 * @author libo/Alex
 * @email liboms@hotmail.com/liboware@163.com  
 * @date 2018年5月5日 
 * @version V1.0 
 */
public final class ImmutableSets {


	/**  
	 * <b>create:创建ImmutableSet不可变集合</b>
	 * <p>创建ImmutableSet不可变集合->使用Guava的copyOf方法</p>
	 * @param elements
	 * @return
	 * @exception
	 */ 
	public static <T> ImmutableSet<T> create(Collection<T> elements){
		return ImmutableSet.copyOf(elements);
	}
	
	/**  
	 * <b>create:创建ImmutableSet不可变集合</b>
	 * <p>创建ImmutableSet不可变集合->使用Guava的copyOf方法</p>
	 * @param elements
	 * @return
	 * @exception
	 */ 
	public static <T> ImmutableSet<T> create(List<T> elements){
		return ImmutableSet.copyOf(elements);
	}
	
	/**  
	 * <b>create:创建ImmutableSet不可变集合</b>
	 * <p>创建ImmutableSet不可变集合->使用Guava的copyOf方法</p>
	 * @param elements
	 * @return
	 * @exception
	 */ 
	public static <T> ImmutableSet<T> create(T[] elements){
		return ImmutableSet.copyOf(elements);
	}
	
	/**  
	 * <b>create:创建ImmutableSet不可变集合</b>
	 * <p>创建ImmutableSet不可变集合->使用Guava的copyOf方法</p>
	 * @param elements
	 * @return
	 * @exception
	 */ 
	public static <T> ImmutableSet<T> create(Set<T> elements){
		return ImmutableSet.copyOf(elements);
	}
	
	/**  
	 * <b>create:创建ImmutableSet不可变集合</b>
	 * <p>创建ImmutableSet不可变集合->使用Guava的copyOf方法</p>
	 * @param elements
	 * @return
	 * @exception
	 */ 
	public static <T> ImmutableSet<T> create(Iterator<T> elements){
		return ImmutableSet.copyOf(elements);
	}
	
}
